Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tint support #298

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

ScottFerwerda
Copy link

We had a need for better support for the tint options in iOS. I added code to make that happen. In some cases, the tint color was being controlled by the NUI background-tint-color property. This struck me as poorly named, since the tint color doesn't always affect just the background. I renamed these to tint-color where appropriate. I did leave support for the old name, but the new name will supersede the old if both exist in the configuration.

@Stunner
Copy link
Collaborator

Stunner commented Jul 9, 2015

Failed the test due to #302.

s.license = { :type => 'MIT', :file => 'LICENSE.txt' }
s.author = { "Tom Benner" => "[email protected]" }
s.source = { :git => "https://github.com/tombenner/nui.git", :tag => "v0.5.5" }
s.source = { :git => "https://github.com/Joulebug/nui.git", :tag => "v0.5.6" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need an intermediary release of your own fork, please make such changes on a different branch than you're using to file a pull request.

@timbodeit
Copy link
Collaborator

The tintColor attribute on UIView is only available on iOS 7 or higher. Classes that didn't have this attribute before and are now getting tint-color support would need appropriate safety checks, to make sure this doesn't crash on a lower iOS Version.

The identically named attributes already existed on some other classes such as UIBarButtonItem or UINavigationBar since iOS 5.

When the tintColor attribute was introduced on UIView, the old tintColor attibutes on the following classes where more or less renamed to barTintColor:

  • UINavigationBar
  • UISearchBar
  • UITabBar
  • UIToolBar

My suggestion would be to set the barTintColor with the background-color attribute on iOS 7 and higher for these classes, instead of the tintColor.

For UIBarButtonItem, UISegmentedControl I think your way of adding the tint-color attribute and deprecating the background-tint-color is the right way to go.

@timbodeit
Copy link
Collaborator

Note: #if __IPHONE_OS_VERSION_MIN_REQUIRED < 70000 is a compile time check. This means that the condition doesn't evaluate the iOS version of the device, that an app is run on, but rather the minimum version the app supports.

While this shouldn't be a big problem for NUI, it would be better to check for capabilities at runtime by calling respondsToSelector: when adding more checks for code that requires a minimum iOS Version.

@joeboyscout04
Copy link

I'm the lead on this project now (wow, it's been awhile). I see the previous PR added bar-tint-color for UISearchBar, could we do something similar for the other Bar classes?

# Conflicts:
#	Demo/NUIDemo.xcworkspace/xcshareddata/NUIDemo.xccheckout
#	NUI/Core/Renderers/NUINavigationBarRenderer.m
#	NUI/Core/Renderers/NUITabBarRenderer.m
#	NUI/Core/Renderers/NUITextViewRenderer.m
#	README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants